import request from '@/utils/request'

export async  function   getAdmins() {
  let res =  await request({
    url: '/Admins?$expand=Company',
    method: 'get',
  })

  return res.data.value;
}
export async function updateAdmin(admin){
  let res =  await request({
    url: `/Admins(${admin.AdminId})`,
    method: 'put',
    data: admin
  })
  return res.data.value;
}
export async function addAdmin(admin){
  //
 
  let res =  await request({
    url: '/Admins?$expand=Company',
    method: 'post',
    data: admin,
  })

  return res.data;
}
export function removeAdmin(id){
  return request({
    url: `/Admins/${id}`,
    method: 'delete',
  })



}
